package org.zsqx.action;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.zsqx.bean.Linkman;
import org.zsqx.bean.YjUser;

@Action(value="/linkmanAction",results={
		@Result(name="linkmanList",location="/settingAction!list.action",type="redirect",params={"className","linkmanBean"})
})
public class LinkmanAction extends BaseAction {
	private YjUser yjUser;
	private Linkman linkman;
	public String linkmanUpdate(){
		YjUser yy = new YjUser();
		yy.setUsername(yjUser.getUsername());
		yy = (YjUser) rd.findOne(yy);
		yjUser.setId(yy.getId());
		rd.update(yjUser);
		rd.update(linkman);
		return "linkmanList";
	}
	public String linkmanDelete(){
		yjUser = (YjUser) rd.findOne(yjUser);
		rd.delete(yjUser);
		return "linkmanList";
	}
	public String linkmanAdd(){
		rd.save(yjUser);
		return "linkmanList";
	}
	public YjUser getYjUser() {
		return yjUser;
	}
	public void setYjUser(YjUser yjUser) {
		this.yjUser = yjUser;
	}
	public Linkman getLinkman() {
		return linkman;
	}
	public void setLinkman(Linkman linkman) {
		this.linkman = linkman;
	}
}
